<template>
  <div class="navbar-box">
    <div v-for="(item,index) in nav" :key="index" class="navbar">
      <router-link class="link" :to="item.link" tag="div">
        <span>{{item.title}}</span>
      </router-link>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      nav: [
        { title: '推荐', link: '/recommend' },
        { title: '歌手', link: '/singer' },
        { title: '排行', link: '/rank' },
        { title: '搜索', link: '/search' }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.navbar-box {
  display: flex;
  margin-top: -1px;
  justify-content: space-around;
  background-color: #222;
  height: 40px;
  line-height: 40px;
  .navbar{
    color: white;
    position: relative;
    font-weight: 300;
    font-size: 14px;
    .link.myactive{
      color: #ffcd32;
      &::after{
        content: "";
        display: block;
        height: 0;
        width: 25px;
        position: absolute;
        top:30px;
        border: 1px solid #ffcd32;
      }
    }
    .link{
    }
  }
}
</style>
